import Vue from 'vue'
import {fetch, put, post, del} from "./baseApi";

Vue.prototype.$fetch = fetch
Vue.prototype.$put = put
Vue.prototype.$post = post
Vue.prototype.$delete = del
export const getGoodsList = (payload) => {
  return Vue.prototype.$fetch("goods", payload)
}
export const deleteGoodsById = (payload) => {
  return Vue.prototype.$delete("goods/" + payload)
}
export const addGoods = (payload) => {
  console.log(payload);
  return Vue.prototype.$post("goods", payload)
}
export const getGoodsById = (id) => {
  return Vue.prototype.$fetch("goods/" + id)
}
